﻿using System;

namespace Microsoft.WowAddonStudio.Lua.Model
{
    /// <summary>
    /// A Lua variable.
    /// </summary>
    public class Variable : ApiDeclaration
    {
        /// <summary>
        /// Gets or sets the type of the variable.
        /// </summary>
        public override LuaType Type
        {
            set
            {
                if (value == LuaType.Function || value == LuaType.Table)
                    throw new ArgumentException("Invalid variable type.", "value");
                    
                base.Type = value;
            }
        }
    }
}
